package com.garlic.face.jlf.transaction.balance;

public class ScaleUtil {
    public static void ScaleZero(SerialPortFunction serialPortFunction){
        try{
            //电子秤归零,重量在量程的±10％以内才响应此命令。
            serialPortFunction.sendEle("5A0D0A");
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }

    //电子秤零点标定
    //零点标定响应时间大约2s。
    public static void ScaleZeroCalibration(SerialPortFunction serialPortFunction){
        try{
            serialPortFunction.sendEle("410D0A");
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }

    public static void ScaleWeightCalibration(SerialPortFunction serialPortFunction, String data){
        try{
            serialPortFunction.sendEle(data);
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }

    public static void ScaleWeightCalibration(SerialPortFunction serialPortFunction, byte[] data){
        try{
            serialPortFunction.sendEle(data);
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }

    public static void ScalePeel(SerialPortFunction serialPortFunction){
        try{
            serialPortFunction.sendEle("540D0A");
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }
    public static void ScalePeelClear(SerialPortFunction serialPortFunction){
        try{
            serialPortFunction.sendEle("430D0A");
        }
        catch (Exception ex){
            ex.getStackTrace();
        }
    }

}
